<?php
namespace app\home\controller;
use app\home\controller\Com;
use think\Session;
use think\Db;

class User extends Com
{
    public function index()
    {
        $user_id=Session::get('user.id');
        $resule=Db::name('user')->where('id',$user_id)->select();
        dump($resule);
        dump(date("Y",time()));
        dump(date("Y",$resule[0]['birth']));
        $resule[0]['age']=date("Y",time())-date("Y",$resule[0]['birth']);
        dump($resule);
        $this->assign('data',$resule[0]);
        return view();
    }
}
